<template>
	<view class="">
		<view class="he1 w100pc"></view>
		<!-- 头部 -->
		<view class="fsb lrmg-30" style="height: 100rpx;">
			<image src="/static/image/9.png" style="width:86rpx;height:50rpx" class="" @click="pageback()"></image>
			<view class="flex aic">
			</view>
		</view>
		<view class="he3 w100pc"></view>
			<view class="gray272 weight f30 lrmg-30">分紅點</view>
			<view class="he4 w100pc"></view>
			<view class="bra20 lrmg-40 fff fcc" style="background: #31B898;padding: 40rpx;height: 300rpx;">
				<view class=" flex jc-center al-end gray333">
					<text class="weight" style="font-size: 60rpx;">{{userInfo.dividend}}</text>
					<text>點</text>
				</view>
			</view>
			<view class="" style="margin: 30rpx 50rpx 0;">
				<view class="mg-t-40 fsb" v-for="(it,i) in list" :key="i">
					<view class="">
						<view class="gray333 weight">{{it.type_name}}</view>
						<view class="f24 mg-t-20" style="color: #9B9B9B;">{{it.add_time}}</view>
					</view>
					<view class="weight f36" style="color: #FE6A6A;" v-if="it.status == 2">{{it.num}}</view>
					<view class="weight f36 gray272" v-if="it.status == 1">+{{it.num}}</view>
				</view>
			</view>
			<view class="he3 w100pc"></view>
			<u-loadmore :status="status" :icon-type="iconType" :load-text="loadText" />
		<view class="he3 w100pc"></view>
	</view>
</template>

<script>
	var	that
	import {
		_updataTabBar,
		pageto,
		pageback
	} from "../../common/js/sysfun.js"
	import {
		mapGetters,
		mapMutations
	} from 'vuex'
	export default{
		data(){
			return{
				userInfo:{},
				status: 'loadmore',
				iconType: 'flower',
				loadText: {
					loadmore: '輕輕上拉',
					loading: '努力加載中',
					nomore: '實在沒有了'
				},
				list: [],
				page: 1,
				pageSize:20,
			}
		},
		computed: {
			i18n() {
				return this.$t('message');
			},
			...mapGetters([
				'getRequestUrl',
				'getLangType',
				'getTextArr',
				'getLoginInfo'
			])
		},
		onReachBottom() {
			if (that.total <= that.page * that.pageSize){
				this.status = 'nomore';
				return
			} 
			this.status = 'loading';
			let postData
			postData = {
				currency:3,
				page:that.page + 1,//第几页（默认第一页）
				limit:that.pageSize,//显示条数（默认10条）
				type:'system_operation',
				status:0
			}
			that.$postAjax('api/Finance/capital_log',postData,function(res){
				console.log(res,2222)
				uni.hideLoading()
				that.list = that.list.concat(res.data.data)
				that.page = that.page + 1
				that.status = 'loadmore';
			})
		},
		onLoad() {
			that = this
			that.getUser()
			that.gets()
		},
		methods:{
			gets(){
				that.status = 'loadmore';
				that.page = 1
				let temp = {
					currency:3,
					page:that.page,//第几页（默认第一页）
					limit:that.pageSize,//显示条数（默认10条）
					type:'',
					status:0
				}
				that.$postAjax('api/Finance/capital_log',temp,function(res){
					console.log(res);
					// console.log(that.getRequestUrl + res.data.class.pic);
					that.list = res.data.data
					that.total = res.data.total
					if (that.total <= that.page * that.pageSize){
						that.status = 'nomore';
					}
				})
			},
			getUser(){
				that.$postAjax('api/Member/wallet','',function(res){
					console.log(res);
					that.userInfo = res.data
				})
			},
			dianji(index) {
				this.current = index;
			},
			pageto(url, pp) {
				pageto(url, pp);
			},
			pageback(){
				pageback()
			}
		}
	}
</script>

<style lang="scss">
	.aaa{border-radius: 40rpx 0 0 40rpx;}
	.bbb{border-radius: 0 40rpx 40rpx 0;}
	.bll{background: #1C416D;width: 50%;height: 100rpx;text-align: center;line-height: 100rpx;color: #fff;}
	.gll{background: #D4D4D4;width: 50%;height: 100rpx;text-align: center;line-height: 100rpx;color: #8A8A8A;}
</style>